<template>
	<div class="content">
		<back-img :isIndex='true'></back-img>
		<img class="content-img" src="@/assets/img/intro.jpg" alt="">
	</div>
</template>

<script>
	import {mapGetters,mapState} from 'vuex';
	export default {
		data() {
			return {
				
			};
		},
		computed: {
			...mapState({
				chooseIndex: 'chooseIndex'
			})
		},
		created() {
			window.addEventListener('popstate', this.handleBackButton);
		},
		// 在组件销毁前
		beforeDestroy() {
		    // 移除监听器
		    window.removeEventListener('popstate', this.handleBackButton);
		},
		watch: {
			
		},
		mounted() {
		
		},
		methods: {
			handleBackButton(event) {
				console.log('返回---')
			      // 阻止默认的返回行为
			    event.preventDefault();
			      // 可以在这里编写自定义的返回逻辑，比如路由跳转
			    this.$router.push('/index');
			},
		}
	};
</script>

<style lang="less" scoped>
	.content{
	    &-img{ 
			width: 100%;
		}
	}
</style>